package jp.millibit.resource
{
	import flash.events.ProgressEvent;

	public class ResourceEvent extends ProgressEvent
	{

		public static const COMPLETE:String = "complete";

		public static const FAILURE:String = "failure";

		public static const PROGRESS:String = "progress";

		private var _resource:Resource;

		private var _error:String;

		private var _rawData:Object;

		public function ResourceEvent(type:String, resource:Resource, rawData:Object, bytesLoaded:uint = 0, bytesTotal:uint = 0, error:String = null)
		{
			super(type, false, false, bytesLoaded, bytesTotal);

			_error = error;
			_resource = resource;
			_rawData = rawData;
		}

		public function get resource():Resource
		{
			return _resource;
		}

		public function get error():String
		{
			return _error;
		}

		public function get rawData():Object
		{
			return _rawData;
		}
	}
}